package com.tzxs.pay.main.gt.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.tzxs.pay.main.app.NoticeDialog;
import com.tzxs.pay.main.app.TzApplication;

import java.util.Objects;

//即时通讯广播
public class NoticeReceiver extends BroadcastReceiver {

    public static final String action = "com.tzxs.pay.main.gt.broadcast.NoticeReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        if (Objects.equals(intent.getAction(), action)) {
            //获取Application对象
            TzApplication app = (TzApplication) context.getApplicationContext();
            NoticeDialog.getInstance(app).showDialog(app.getActivity(), intent.getParcelableExtra("msg"));

        }
    }

}
